<template>
	<view class="content">
		<view class="text">单位净值</view>
		<view class="title"></view>
		<view class="charts-box">
			<view class="charts-box">
				<qiun-data-charts type="area" :ontouch="true" :canvas2d="true" :opts="opts" :chartData="column1" background="none"
					:animation="false" />
			</view>

		</view>


	</view>
</template>

<script>
	import {
		createNamespacedHelpers
	} from 'vuex';
	const {
		mapState,
		mapMutations,
		mapActions
	} = createNamespacedHelpers('licai');
	const {mapActions:huangjActions,mapState:huangjState} = createNamespacedHelpers('huangjin')
	export default {
		name: "tubiao",
		props: ['ids','times'],
		mounted() {
			// this.getminuteProducts({
			// 	id: this.ids
			// });
			// this.getcurrentTimes({
			// 	time:this.times
			// })
		},
		data() {
			return {
				opts: {
					"type": "area",
					"canvasId": "",
					"canvas2d": true,
					"background": "none",
					"animation": true,
					"timing": "easeIn",
					"duration": 1000,
					"color": [
						"#1890FF",
						"#91CB74",
						"#FAC858",
						"#EE6666",
						"#73C0DE",
						"#3CA272",
						"#FC8452",
						"#9A60B4",
						"#ea7ccc"
					],
					"padding": [
						15,
						15,
						0,
						15
					],
					"rotate": false,
					"reserve": false,
					"fontSize": 13,
					"fontColor": "#666666",
					"enableScroll": true,
					"touchMoveLimit": 60,
					"enableMarkLine": false,
					"dataLabel": true,
					"dataPointShape": false,
					"dataPointShapeType": "solid",
					"xAxis": {
						"disabled": false,
						"axisLine": true,
						"axisLineColor": "#CCCCCC",
						"calibration": false,
						"fontColor": "#666666",
						"fontSize": 8,
						"rotateLabel": false,
						"itemCount": 5,
						"boundaryGap": "center",
						"disableGrid": true,
						"gridColor": "#CCCCCC",
						"gridType": "solid",
						"dashLength": 4,
						"gridEval": 1,
						"scrollShow": true,
						"scrollAlign": "left",
						"scrollColor": "#A6A6A6",
						"scrollBackgroundColor": "#EFEBEF"
					},
					"yAxis": {
						"disabled": false,
						"disableGrid": true,
						"splitNumber": 5,
						"gridType": "dash",
						"dashLength": 2,
						"gridColor": "#CCCCCC",
						"padding": 10,
						"showTitle": false,
						"data": [{
							"position": "left",
							"disabled": false,
							"axisLine": true,
							"axisLineColor": "#CCCCCC",
							"calibration": false,
							"fontColor": "#666666",
							"fontSize": 8,
							"textAlign": "right",
							"title": "",
							"titleFontSize": 13,
							"titleFontColor": "#666666",
							"min": null,
							"max": null,
							"tofix": 3,
							"unit": "",
							"format": ""
						}]
					},
					"legend": {
						"show": false,
						"position": "bottom",
						"float": "center",
						"padding": 5,
						"margin": 5,
						"backgroundColor": "rgba(0,0,0,0)",
						"borderColor": "rgba(0,0,0,0)",
						"borderWidth": 0,
						"fontSize": 13,
						"fontColor": "#666666",
						"lineHeight": 11,
						"hiddenColor": "#CECECE",
						"itemGap": 10
					},
					"extra": {
						"area": {
							"type": "curve",
							"opacity": 0.2,
							"addLine": true,
							"width": 2,
							"gradient": true
						},
						"tooltip": {
							"showBox": true,
							"showArrow": true,
							"borderWidth": 0,
							"borderRadius": 0,
							"borderColor": "#000000",
							"borderOpacity": 0.7,
							"bgColor": "#000000",
							"bgOpacity": 0.7,
							"gridType": "solid",
							"dashLength": 4,
							"gridColor": "#CCCCCC",
							"fontColor": "#FFFFFF",
							"splitLine": true,
							"horizentalLine": false,
							"xAxisLabel": false,
							"yAxisLabel": false,
							"labelBgColor": "#FFFFFF",
							"labelBgOpacity": 0.7,
							"labelFontColor": "#666666"
						},
						"markLine": {
							"type": "solid",
							"dashLength": 4,
							"data": []
						}
					}

				},
			}
		},
		methods: {
			...mapActions(['getminuteProducts','getcurrentTimes']),
		},
		computed: {
			...mapState(['listData','time']),
			column1() {
				return {
					"categories": [...this.time],
					"series": [{
						"name": "",
						"data": [...this.listData]
					}]
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.text {
		margin-top: 30rpx;
		height: 60rpx;
		text-align: center;
	}

	.content {
		display: flex;
		flex-direction: column;
		flex: 1;
		margin-top: 20rpx;
	}

	.charts-box {
		width: 100%;
		height: 300px;

	}

	.fenlei {

		height: 60rpx;
		width: 90%;
		margin: 20rpx auto;
		border: 1px solid #cdcdcd;
		border-radius: 20rpx;
		display: flex;

		view {
			width: 25%;
			text-align: center;
			line-height: 60rpx;
			border-right: 1px solid #cdcdcd;
		}
	}

	.xuanzhong {
		background-color: #ff4658;
		color: #FFFFFF;
		border-radius: 20rpx;
	}
</style>
